#!/usr/bin/perl -w

use strict;

use XML::Simple;

my $conf = shift;
if (not defined $conf) {
	die "Usage: schema-dump path/to/hackabot.xml";
}

my $CONFIG = XMLin($conf);

system("mysqldump --no-data --skip-lock-tables --skip-add-drop-table"
	." --host=".$CONFIG->{'cmdconfig'}->{"database"}->{"host"}
	." --user=".$CONFIG->{'cmdconfig'}->{"database"}->{"user"}
	." --password=".$CONFIG->{'cmdconfig'}->{"database"}->{"pass"}
	." ".$CONFIG->{'cmdconfig'}->{"database"}->{"name"}
	." | sed -e 's/^).*;\$/);/'");

